function [stream, bits] = logarithm_data (x, limit)
L=length(x(:));
bits= 0;
stream = zeros (1,L);
for i=1:L
   if (x(i) > limit)
       b = floor (log2(x(i)+1-limit));
       bits = bits + b;
       stream(i) = b + limit;
   else 
       stream(i) = x(i);
   end
end
end
